package com.net.csmacd.utils;

public class Delaytime {

    /**
     * 截断的二进制指数退避算法
     *
     * @param n
     * @return
     */
    public int returntime(int n) {
        int random;
        int temp;
        temp = Math.min(n, 10);
        random = (int) (Math.random() * (Math.pow(2, temp) - 1));
        return random;
    }
}
